package cn.vivi.seckill.controller;


import cn.vivi.seckill.service.OrderService;
import cn.vivi.seckill.vo.OrderVo;
import cn.vivi.seckill.vo.RespBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/orders")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping("/detail/{id}")
    public RespBean detail(@PathVariable("id") String orderId) {
        OrderVo orderVo = orderService.detail(orderId);
        return RespBean.success(orderVo);
    }

}
